package cate.common.table.conditiontask;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.table.d.GDTask;
import easy.java.dev.note.NoteField;

public class ConditionRow extends ERow {
    @NoteField(value = "完成后操作id")
    public int tid;

    @NoteField(value = "事件类型")
    public int event;

    @NoteField(value = "参数")
    public int param;

    @NoteField(value = "检测操作")
    public byte checkOper;

    @NoteField(value = "目标值")
    public long value;

    @NoteField(value = "任务持续时间类型")
    public byte taskDuration;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("条件ID");
        this.tid = xrw.getInteger("条件ID");
        this.event = xrw.getInteger("事件类型", 0);
        this.param = xrw.getInteger("参数", 0);
        this.checkOper = xrw.getByte("检测操作", GDTask.CheckOper.EQ);
        this.value = xrw.getLong("目标值", 1L);
        this.taskDuration = xrw.getByte("任务持续时间类型", GDTask.Duration.PERMANENT);
    }
}
